package com.qyl.honghengshop.controller.admin;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.qyl.honghengshop.dto.Order;
import com.qyl.honghengshop.service.OrderService;
import com.qyl.honghengshop.service.impl.OrderServiceImpl;
import com.qyl.honghengshop.utils.PageBean;

@Controller
@RequestMapping("/admin/order")
public class OrderController {

	private OrderService orderService = new OrderServiceImpl();
	
	@RequestMapping("/orderList")
	public String orderList(Integer pageIndex,Integer pageSize,Order order,ModelMap map){
		
		int recordCount = orderService.getRecordCount(order);
		
		PageBean pageBean = new PageBean(pageIndex, recordCount, pageSize);
		
		orderService.orderList(pageBean,order);
		
		map.put("pageBean", pageBean);
		
		map.put("order", order);
		
		return "order/orderList";
	}
	
}
